/**
 * 
 */
package com.haisen.lee.domain;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;

import com.haisen.lee.util.HtmlStructureType;
import com.haisen.lee.util.SupportJavaScriptType;

/**
 * @author Haisen Lee
 * 
 */
public class HtmlPage {

	private SearchPage selfSearchPage;
	private URI selfUri;
	private String strSelfUri;
	private String encode;
	private List<HtmlPage> subHtmlPages = new ArrayList<HtmlPage>();
	private List<Form> forms = new ArrayList<Form>();
	private HtmlStructureType htmlStructureType = HtmlStructureType.singleHtmlType;
	private SupportJavaScriptType supportJavaScriptType = SupportJavaScriptType.pure;

	/**
	 * default constructor
	 */
	public HtmlPage() {
		super();
	}

	@Override
	public int hashCode() {
		return selfSearchPage.hashCode();
	}

	public SearchPage getSelfSearchPage() {
		return selfSearchPage;
	}

	public void setSelfSearchPage(SearchPage selfSearchPage) {
		this.selfSearchPage = selfSearchPage;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof HtmlPage)) {
			return false;
		}
		HtmlPage other = (HtmlPage) obj;
		return this.selfSearchPage.equals(other.getSelfSearchPage())
				&& this.strSelfUri.equals(other.getStrSelfUri());
	}

	public URI getSelfUri() {
		return selfUri;
	}

	public void setSelfUri(URI selfUri) {
		this.selfUri = selfUri;
	}

	public String getStrSelfUri() {
		return strSelfUri;
	}

	public void setStrSelfUri(String strSelfUri) {
		this.strSelfUri = strSelfUri;
	}

	public List<HtmlPage> getSubHtmlPages() {
		return subHtmlPages;
	}

	public void setSubHtmlPages(List<HtmlPage> subHtmlPages) {
		this.subHtmlPages = subHtmlPages;
	}

	public List<Form> getForms() {
		return forms;
	}

	public void setForms(List<Form> forms) {
		this.forms = forms;
	}

	public HtmlStructureType getHtmlStructureType() {
		return htmlStructureType;
	}

	public String getEncode() {
		return encode;
	}

	public void setEncode(String encode) {
		this.encode = encode;
	}

	public SupportJavaScriptType getSupportJavaScriptType() {
		return supportJavaScriptType;
	}
}
